#include "EnvMapSample.h"
#include "Common.h"
#include "resource.h"

namespace FinalRendering
{
	namespace Plugin
	{
		RefPtr<GxRendering::UI::Image> EnvMapSampleDesc::logoImage;

		const wchar_t * envMapSampleClassName = L"EnvMapSample";
		EnvMapSampleDesc envMapSampleDesc;

		const wchar_t * EnvMapSampleDesc::ClassName()
		{
			return envMapSampleClassName;
		}
		IEntity * EnvMapSampleDesc::Create()
		{
			return new EnvMapSample();
		}
		void EnvMapSampleDesc::Destroy(IEntity * ent)
		{
			delete ent;
		}

		IEntity * EnvMapSampleDesc::Create(Stream * stream)
		{
			return new EnvMapSample();
		}

		void EnvMapSample::InitPlugin(bool isEditor, IEngine * _engine, HMODULE module)
		{
			if (isEditor)
				EnvMapSampleDesc::logoImage = new GxRendering::UI::Image(&GxWinGUI::Drawing::Bitmap(IDB_ENT_CUBEMAP,(HMODULE)module), &GxRendering::UI::Color(0,0,0,0));
		}
		void EnvMapSample::DestroyPlugin()
		{
			EnvMapSampleDesc::logoImage = 0;
		}
		IEntityDesc * EnvMapSampleDesc::GetDesc()
		{
			return &envMapSampleDesc;
		}
		IEntityDesc * EnvMapSample::GetDesc()
		{
			return &envMapSampleDesc;
		}
		void EnvMapSample::EditorDraw(IView *view)
		{
			DrawEntity(this, view, Position, EnvMapSampleDesc::logoImage);
		}

		EnvMapSample::EnvMapSample()
		{

		}

		EnvMapSample::EnvMapSample(Stream * stream)
			:PointEntity(stream)
		{

		}
	}
}